package com.lyj.ai;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@MapperScan("com.lyj.ai.mapper")
public class AiApplication {

    public static void main(String[] args) {
        System.out.println("OPENAI_API_KEY: " + System.getenv("OPENAI_API_KEY"));
        System.out.println("MYSQL_USER_NAME: " + System.getenv("MYSQL_USER_NAME"));
        System.out.println("MYSQL_USER_PASSWORD: " + System.getenv("MYSQL_USER_PASSWORD"));
        SpringApplication.run(AiApplication.class, args);
    }


//    @Bean
//    public CommandLineRunner runner(ChatClient.Builder builder) {
//        return args -> {
//            ChatClient chatClient = builder.build();
//            String response = chatClient.prompt("Tell me a joke").call().content();
//            System.out.println(response);
//        };
//    }


}
